home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <types.h>
- #include <quickdraw.h>
- #include <toolutils.h>
- #include <fonts.h>
- #include <events.h>
- #include <windows.h>
- #include <dialogs.h>
- #include <menus.h>
- #include <desk.h>
- #include <textedit.h>
- #include <scrap.h>
- #include <segload.h>
- #include <osutils.h>
- #include <files.h>
- #include <toolutils.h>
- #include <packages.h>
- #include <resources.h>
- #include <HyperXCmd.h>
-
- /******* TEKXCMD ********************************************/
-
- pascal void pictxcmd(paramPtr)
-
- XCmdBlockPtr paramPtr;
-
- {
- FILE *fp; /* File pointer to tektronix file */
- SFReply reply;
- Point where;
- long filetype[4];
- char junk;
- Str255 str, **res_str,**newcard,**copypic,**delete,**dragpic, **browse, **transparent;
- long tlong;
- PicHandle tpic;
- Rect tr;
- int i=1000, res_number;
- int count;
- Boolean cardFieldFlag;
-
- where.h = 150;
- where.v = 120;
- filetype[0]='TEXT';
- filetype[1]='TEXT';
- filetype[2]='TEXT';
- filetype[3]='TEXT';
-
- res_str=(Str255 **)GetResource('STR ',101);
-
- if( res_str != 0L)
- SFGetFile(&where, *res_str, 0L, -1, filetype, 0L, &reply);
- if( !reply.good ) return;
-
- SetVol( 0L, reply.vRefNum);
- ptoc(&reply.fName);
-
- newcard =(Str255 **) GetResource('STR ',102);
- copypic =(Str255 **) GetResource('STR ',103);
- dragpic =(Str255 **) GetResource('STR ',104);
- browse =(Str255 **) GetResource('STR ',105);
- transparent =(Str255 **) GetResource('STR ',107);
- delete =(Str255 **) GetResource('STR ',108);
- HLock(newcard);
- HLock(copypic);
- HLock(dragpic);
- HLock(browse);
- HLock(delete);
-
- res_number = OpenResFile(&reply.fName);
-
- while( tpic=GetResource('PICT',i) )
- {
- tlong=ZeroScrap();
- HLock(tpic);
- tlong=PutScrap(GetHandleSize(tpic),'PICT',*tpic);
- SendCardMessage(paramPtr,*newcard);
- SendCardMessage(paramPtr,*copypic);
- SendCardMessage(paramPtr,*transparent);
- HUnlock(tpic);
- ReleaseResource(tpic);
- i++;
- }
- SendCardMessage(paramPtr,*delete);
- SendCardMessage(paramPtr,*browse);
- CloseResFile(res_number);
-
- }
- /* END tekxcmd */
-
- /* Thanks to Tim K. for this function */
- ptoc(s)
- char *s;
- {
- register int len;
-
- len = *s+1;
-
- while( --len )
- {
- *s = *(s+1);
- s++;
- }
-
- *s = '\0';
- }
-
- #include <XCmdGlue.inc.c>
-